﻿Imports System.Data.SqlClient
Imports System.Text.RegularExpressions

Module Declaration
    Public Con As SqlConnection
    Public Cmd As SqlCommand
    Public Cmde As SqlCommand
    Public Dr As SqlDataReader
    Public Dre As SqlDataReader
    Public Da As SqlDataAdapter
    Public Ds As DataSet
    Public Tr As SqlTransaction = Nothing
    Public rech As String = ""
    Public rechEqui As String = ""
    Public modif As Integer = -1
    Public liste As String = ""
    Public id_event As Integer = 0
    Public id_loc As Integer = 0
    Public dse As New DataSet1
    Public dss As New DataSet2
    Public bon As String = ""
    Public RechPersonl As String = ""
    Public numDemande As Integer = 0
    Public datEven As String
    Public lieu As String
    Public N_J As String

    Public Sub StandardInitial() 'Initialise tous les objets dont on a utilisé
        Dim cou As Integer = Application.OpenForms.Count - 1
        Dim i As Integer = 0
        While i <= cou
            If Application.OpenForms.Item(i).Name <> "Frm_Main" Then
                Application.OpenForms.Item(i).Close()
                cou -= 1
                i -= 1
            End If
            i += 1
        End While
    End Sub

    Public Function regEmail(ByVal Email As String) As Boolean
        Dim myRegex As System.Text.RegularExpressions.Regex
        myRegex = New Regex("^([+-.\w]+)@([-.\w]+)\.([-.\w]+)$")
        Dim l As Boolean = myRegex.IsMatch(Email)
        Return l
    End Function
End Module
